package org.swust.monitor.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.swust.monitor.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.swust.monitor.entity.dto.SysUserDto;
import org.swust.monitor.entity.vo.QSysUser;
import org.swust.monitor.service.ISysUserService;
import org.swust.monitor.entity.R;

import java.util.List;

/**
 * <p>
 * 系统用户表 Mapper 接口
 * </p>
 *
 * @author hanxinxin
 * @since 2024-12-31
 */
@Mapper
//@AllArgsConstructor
public interface SysUserMapper extends BaseMapper<SysUser> {
//    private final ISysUserService userService;
//    /**
//     * 通过ID查询用户信息
//     *
//     * @param id ID
//     * @return 用户信息
//     */
//    @GetMapping("/{id}")
//    public R user(@PathVariable Integer id) {
//        return R.ok(userService.getById(id));
//    }

    /*
     * 更新用户状态
     */
    @Update("UPDATE sys_user SET status = #{status} WHERE userId = #{userId}")
    int updateStatusById(Integer userId, boolean status);

    Page<SysUserDto> pageUser(Page<SysUserDto> page,
                                @Param("param") QSysUser qSysUser);

    List<SysUserDto> listUser(@Param("param") QSysUser qSysUser);





}
